#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
int* Change_order(int* arr, const int sz) {
	assert(arr);
	int* right = arr + sz - 1;
	int temp = 0;
	int i = 0;
	while (1) {
		while (arr[i] % 2 != 0 && arr + i != right)
			i++;
		while (*right % 2 == 0 && arr + i != right)
			right--;
		if (arr + i == right)
			return arr;
		temp = arr[i];
		arr[i] = *right;
		*right = temp;
	}
}

int main() {
	int arr[10] = { 5,1,2,8,4,7,3,10,6,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Change_order(arr, sz);
	for (int i = 0; i < sz; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}
